#include "widget.h"
#include "ui_widget.h"
#include<QString>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_pushButton_clicked()
{
    int a=ui->tableWidget->columnCount();
    QString s=ui->lineEdit->text();
    ui->tableWidget->insertColumn(a);
    ui->tableWidget->setHorizontalHeaderItem(a, new QTableWidgetItem(s));
}

void Widget::on_pushButton_2_clicked()
{
    int a=ui->tableWidget->currentColumn();
    ui->tableWidget->removeColumn(a);
}

void Widget::on_pushButton_3_clicked()
{
    int a=ui->tableWidget->rowCount();
    ui->tableWidget->insertRow(a);
}

void Widget::on_pushButton_4_clicked()
{
    int a=ui->tableWidget->currentRow();
    ui->tableWidget->removeRow(a);
}
